<template>
    <input type="text" v-model="CityName">
</template>

<script setup>
import { watch, ref } from 'vue'
const CityName = ref('beijing')
watch(CityName, (newVal, oldVal) => {
    console.log(newVal, oldVal)
})
</script>